<?php
class Ecore_Auth extends Zend_Auth {
	var $Auth = null;
	public function __construct() {
		$this->Auth = parent::getInstance();
	}
	/**
	* @intSite: 0 - frontend; 1 - backend
	*/
	public function auth($objUser,$intSite=0) {		
		if($intSite == 0) {			
			$this->Auth->setStorage(new Zend_Auth_Storage_Session(SESSION_FRONTEND_AUTH));			
		}
		else {
			$this->Auth->setStorage(new Zend_Auth_Storage_Session(SESSION_BACKEND_AUTH));
		}		
		$this->Auth->getStorage()->write($objUser);
		return $objUser;		
	}
}
?>